function validateApplication() {
    var pls_enter_applicant_name = "<br>" + document.getElementById("pls_enter_applicant_name").value;
    var pls_enter_submit_date = "<br>" + document.getElementById("pls_enter_submit_date").value;
    var pls_enter_applicant_address = "<br>" + document.getElementById("pls_enter_applicant_address").value;
    var pls_enter_valid_email = "<br>" + document.getElementById("pls_enter_valid_email").value;
    var pls_enter_valid_phone_No = "<br>" + document.getElementById("pls_enter_valid_phone_No").value;
    var pls_enter_valid_NIC_No = "<br>" + document.getElementById("pls_enter_valid_NIC_No").value;
    var pls_enter_annual_income = "<br>" + document.getElementById("pls_enter_annual_income").value;
    var pls_enter_valid_annual_income = "<br>" + document.getElementById("pls_enter_valid_annual_income").value;
    var applicant_age_validate = "<br>" + document.getElementById("applicant_age_validate").value;
    var pls_enter_the_applicant_dob = "<br>" + document.getElementById("pls_enter_the_applicant_dob").value;
    var pls_enter_valid_value = "<br>" + document.getElementById("pls_enter_valid_value").value;
    var pls_enter_children_name = "<br>" + document.getElementById("pls_enter_children_name").value;
    var pls_select_nationality = document.getElementById("pls_select_nationality").value;
    var pls_select_gn_division = $("#pls_select_gnDivision").val();
    var pls_select_applicant_type = $("#pls_select_applicant_type").val();


    $("#gov-land-init-permit-application-form").validate({
        rules: {
            personId: {
                required: true
            },
            submitDate:{
                required:true,
                isDateFormated: true
            },
            personAddress:{
                required:true
            },
            emailId:{
                email:true
            },
            mobileId:{
                phoneNo:true
            },
            landPhoneId:{
                phoneNo:true
            },
            personNICNoId:{
                NICNo:true
            },
            annualIncome:{
                required:true,
                number:true
            },
            dateOfBirth:{
                required:true,
                isDateFormated: true,
                ageValidate:true
            },
            roodsId:{
                required:true
            },
            acreId:{
                required:true
            },
            hectareId:{
                number:true
            },
            // childError:{
            //     childTable:true
            // },
            nationalityIdtrue:{
                nationality:true
            },
            nationalityIdfalse:{
                nationality:true
            },
            gnDivisionId:{
                selectBox:"default"
            },
            applicantType0:{
                required:true
            },
            applicantType1:{
                required:true
            }
        },
        messages: {
            personId: {
                required: pls_enter_applicant_name
            },
            submitDate:{
                required:pls_enter_submit_date
            },
            personAddress:{
                required:pls_enter_applicant_address
            },
            mailId:pls_enter_valid_email,
            mobileId:pls_enter_valid_phone_No,
            landPhoneId:pls_enter_valid_phone_No,
            personNICNoId:pls_enter_valid_NIC_No,
            annualIncome:{
                required :pls_enter_annual_income,
                number:pls_enter_valid_annual_income
            },
            dateOfBirth:{
                required:pls_enter_the_applicant_dob,
                ageValidate: applicant_age_validate
            },
            hectareId:pls_enter_valid_value,
            acreId:pls_enter_valid_value,
            roodsId:pls_enter_valid_value,
            perchesId:pls_enter_valid_value,
            // childError:pls_enter_children_name,
            nationalityIdtrue:{
                nationality:pls_select_nationality
            },
            nationalityIdfalse:{
                nationality:pls_select_nationality
            },
            gnDivisionId:{
                selectBox:pls_select_gn_division
            },
            applicantType:{
                required:pls_select_applicant_type
            },
            applicantType1:{
                required:pls_select_applicant_type
            }
        },
        invalidHandler: function(form, validator) {
            var errors = validator.numberOfInvalids();
            if (errors) {
                var invalidPanels = $(validator.invalidElements()).closest(".ui-tabs-panel", form);
                if (invalidPanels.size() > 0) {
                    $.each($.unique(invalidPanels.get()), function() {
                        $(this).siblings(".ui-tabs-nav")
                                .find("a[href='#" + this.id + "']").parent().not(".ui-tabs-selected")
                                .addClass("ui-state-error")
                                .show("pulsate", {times: 3});
                    });
                }
            }
        },
        unhighlight: function(element, errorClass, validClass) {
            $(element).removeClass(errorClass);
            $(element.form).find("label[for=" + element.id + "]").removeClass(errorClass);
            var $panel = $(element).closest(".ui-tabs-panel", element.form);
            if ($panel.size() > 0) {
                if ($panel.find("." + errorClass + ":visible").size() == 0) {
                    $panel.siblings(".ui-tabs-nav").find("a[href='#" + $panel[0].id + "']")
                            .parent().removeClass("ui-state-error");
                }
            }
        }
    });
}